package com.tceasy.gateway.service

import org.junit.Test
import org.springframework.beans.factory.annotation.Autowired

import base.TestEnviroment

import com.tceasy.gateway.dao.DeveloperDao
import com.tceasy.gateway.dao.UserDao
import com.tceasy.gateway.domain.OpenUser

/**
 * Created by zhanghuan on 2016/4/12.
 */
class UserServiceTest extends TestEnviroment {
    @Autowired
    UserDao userDao
	@Autowired
	DeveloperService developerService;
	@Autowired
    DeveloperDao developerDao
	
    @Test
    public void testAddUser(){
        def user=new OpenUser()
        user.setUsername("openadmin")
        user.setPasswd("123")
        userDao.insert(user)
    }
	
	@Test
	public void findOneByShortNameTest(){
		println developerDao.findOne([shortName:"aaaa"]);
		println developerService.findOneByShortName("aaaa");
	}
}
